package com.atguigu.edustatistics.demo.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @Author: Cyrus
 * @CreateDate: 2020/12/7
 */
public class ExcelListener extends AnalysisEventListener<DemoData> {
    /**
     * 一行一行读取excel中内容
     */
    @Override
    public void invoke(DemoData data, AnalysisContext context) {
        System.out.println("***"+data);

    }
    /**
     * 获取表头内容
     */
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头"+headMap);
    }

    /**
     * 读取完之后执行
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}
